In D:\1\eclpok\pgjdbc: "C:\Program Files\TortoiseCVS\cvs.exe" "-q" "diff" "-u" "-r" "1.21" "org/postgresql/jdbc3/AbstractJdbc3Statement.java"
CVSROOT=:pserver:anonymous@gborg.postgresql.org:/usr/local/cvsroot/pgjdbc

Index: org/postgresql/jdbc3/AbstractJdbc3Statement.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc3/AbstractJdbc3Statement.java,v
retrieving revision 1.21
diff -u -r1.21 AbstractJdbc3Statement.java
--- org/postgresql/jdbc3/AbstractJdbc3Statement.java	8 Jun 2006 10:34:50 -0000	1.21
+++ org/postgresql/jdbc3/AbstractJdbc3Statement.java	5 Jul 2006 19:32:08 -0000
@@ -12,6 +12,9 @@
 import java.math.BigDecimal;
 import java.sql.*;
 import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
 import java.util.Vector;
 
 import org.postgresql.util.PSQLException;
@@ -405,7 +408,11 @@
     public void registerOutParameter(String parameterName, int sqlType)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "registerOutParameter(String,int)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		registerOutParameter(index,sqlType);
     }
 
     /**
@@ -432,7 +439,11 @@
     public void registerOutParameter(String parameterName, int sqlType, int scale)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "registerOutParameter(String,int,int)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		registerOutParameter(index,sqlType,scale);
     }
 
     /**
@@ -472,7 +483,11 @@
     public void registerOutParameter (String parameterName, int sqlType, String typeName)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "registerOutParameter(String,int,String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		registerOutParameter(index,sqlType,typeName);
     }
 
     /**
@@ -523,7 +538,11 @@
      */
     public void setNull(String parameterName, int sqlType) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setNull(String,int)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setNull(index,sqlType);
     }
 
     /**
@@ -539,7 +558,11 @@
      */
     public void setBoolean(String parameterName, boolean x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setBoolean(String,boolean)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setBoolean(index,x);
     }
 
     /**
@@ -555,7 +578,11 @@
      */
     public void setByte(String parameterName, byte x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setByte(String,byte)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setByte(index,x);
     }
 
     /**
@@ -571,7 +598,11 @@
      */
     public void setShort(String parameterName, short x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setShort(String,short)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setShort(index,x);
     }
 
     /**
@@ -587,7 +618,11 @@
      */
     public void setInt(String parameterName, int x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setInt(String,int)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setInt(index,x);
     }
 
     /**
@@ -603,7 +638,11 @@
      */
     public void setLong(String parameterName, long x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setLong(String,long)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setLong(index,x);
     }
 
     /**
@@ -619,7 +658,11 @@
      */
     public void setFloat(String parameterName, float x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setFloat(String,float)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setFloat(index,x);
     }
 
     /**
@@ -635,7 +678,11 @@
      */
     public void setDouble(String parameterName, double x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setDouble(String,double)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setDouble(index,x);
     }
 
     /**
@@ -652,7 +699,11 @@
      */
     public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setBigDecimal(String,BigDecimal)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setBigDecimal(index,x);
     }
 
     /**
@@ -671,7 +722,11 @@
      */
     public void setString(String parameterName, String x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setString(String,String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setString(index,x);
     }
 
     /**
@@ -689,7 +744,11 @@
      */
     public void setBytes(String parameterName, byte x[]) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setBytes(String,byte)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setBytes(index,x);
     }
 
     /**
@@ -706,7 +765,11 @@
     public void setDate(String parameterName, java.sql.Date x)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setDate(String,Date)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setDate(index,x);
     }
 
     /**
@@ -723,7 +786,11 @@
     public void setTime(String parameterName, java.sql.Time x)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setTime(String,Time)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setTime(index,x);
     }
 
     /**
@@ -741,7 +808,11 @@
     public void setTimestamp(String parameterName, java.sql.Timestamp x)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setTimestamp(String,Timestamp)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setTimestamp(index,x);
     }
 
     /**
@@ -766,7 +837,11 @@
     public void setAsciiStream(String parameterName, java.io.InputStream x, int length)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(String,InputStream,int)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setAsciiStream(index,x,length);
     }
 
     /**
@@ -790,45 +865,59 @@
     public void setBinaryStream(String parameterName, java.io.InputStream x,
                                 int length) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setBinaryStream(String,InputStream,int)");
+       	int index = findParameterIndex(parameterName);
+		if (index == -1)
+			throw org.postgresql.Driver.notImplemented(this.getClass(),
+					"setInt(String,int)");
+		else
+			setBinaryStream(index, x,length);
     }
 
     /**
-     * Sets the value of the designated parameter with the given object. The second
-     * argument must be an object type; for integral values, the
-     * <code>java.lang</code> equivalent objects should be used.
-     *
-     * <p>The given Java object will be converted to the given targetSqlType
-     * before being sent to the database.
-     *
-     * If the object has a custom mapping (is of a class implementing the
-     * interface <code>SQLData</code>),
-     * the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it
-     * to the SQL data stream.
-     * If, on the other hand, the object is of a class implementing
-     * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>Struct</code>,
-     * or <code>Array</code>, the driver should pass it to the database as a
-     * value of the corresponding SQL type.
-     * <P>
-     * Note that this method may be used to pass datatabase-
-     * specific abstract data types.
-     *
-     * @param parameterName the name of the parameter
-     * @param x the object containing the input parameter value
-     * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
-     * sent to the database. The scale argument may further qualify this type.
-     * @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
-     *   this is the number of digits after the decimal point.  For all other
-     *   types, this value will be ignored.
-     * @exception SQLException if a database access error occurs
-     * @see Types
-     * @see #getObject
-     * @since 1.4
-     */
+	 * Sets the value of the designated parameter with the given object. The
+	 * second argument must be an object type; for integral values, the
+	 * <code>java.lang</code> equivalent objects should be used.
+	 * 
+	 * <p>
+	 * The given Java object will be converted to the given targetSqlType before
+	 * being sent to the database.
+	 * 
+	 * If the object has a custom mapping (is of a class implementing the
+	 * interface <code>SQLData</code>), the JDBC driver should call the
+	 * method <code>SQLData.writeSQL</code> to write it to the SQL data
+	 * stream. If, on the other hand, the object is of a class implementing
+	 * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,
+	 * <code>Struct</code>, or <code>Array</code>, the driver should pass
+	 * it to the database as a value of the corresponding SQL type.
+	 * <P>
+	 * Note that this method may be used to pass datatabase- specific abstract
+	 * data types.
+	 * 
+	 * @param parameterName
+	 *            the name of the parameter
+	 * @param x
+	 *            the object containing the input parameter value
+	 * @param targetSqlType
+	 *            the SQL type (as defined in java.sql.Types) to be sent to the
+	 *            database. The scale argument may further qualify this type.
+	 * @param scale
+	 *            for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,
+	 *            this is the number of digits after the decimal point. For all
+	 *            other types, this value will be ignored.
+	 * @exception SQLException
+	 *                if a database access error occurs
+	 * @see Types
+	 * @see #getObject
+	 * @since 1.4
+	 */
     public void setObject(String parameterName, Object x, int targetSqlType, int scale)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setObject(String,Object,int,int)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setObject(index,x,targetSqlType,scale);
     }
 
     /**
@@ -847,7 +936,11 @@
     public void setObject(String parameterName, Object x, int targetSqlType)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setObject(String,Object,int)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setObject(index,x,targetSqlType);
     }
 
     /**
@@ -884,7 +977,11 @@
      */
     public void setObject(String parameterName, Object x) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setObject(String,Object)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setObject(index,x);
     }
 
 
@@ -912,7 +1009,11 @@
                                    java.io.Reader reader,
                                    int length) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(String,Reader,int)");
+                                   	int index = findParameterIndex(parameterName);
+                                	if (index == -1)
+                                		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+                                	else
+                                		setCharacterStream(index,reader,length);
     }
 
     /**
@@ -936,7 +1037,11 @@
     public void setDate(String parameterName, java.sql.Date x, Calendar cal)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setDate(String,Date,Calendar)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setDate(index,x,cal);
     }
 
     /**
@@ -960,7 +1065,11 @@
     public void setTime(String parameterName, java.sql.Time x, Calendar cal)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setTime(String,Time,Calendar)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setTime(index,x,cal);
     }
 
     /**
@@ -984,7 +1093,11 @@
     public void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setTimestamp(String,Timestamp,Calendar)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setTimestamp(index,x,cal);
     }
 
     /**
@@ -1019,7 +1132,11 @@
     public void setNull (String parameterName, int sqlType, String typeName)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "setNull(String,int,String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		setNull(index,sqlType);
     }
 
     /**
@@ -1041,7 +1158,11 @@
      */
     public String getString(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getString(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getString(index);
     }
 
     /**
@@ -1056,7 +1177,11 @@
      */
     public boolean getBoolean(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getBoolean(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getBoolean(index);
     }
 
     /**
@@ -1071,7 +1196,11 @@
      */
     public byte getByte(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getByte(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getByte(index);
     }
 
     /**
@@ -1086,7 +1215,11 @@
      */
     public short getShort(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getShort(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getShort(index);
     }
 
     /**
@@ -1102,7 +1235,11 @@
      */
     public int getInt(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getInt(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getInt(index);
     }
 
     /**
@@ -1118,7 +1255,11 @@
      */
     public long getLong(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getLong(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getLong(index);
     }
 
     /**
@@ -1133,7 +1274,11 @@
      */
     public float getFloat(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getFloat(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getFloat(index);
     }
 
     /**
@@ -1148,7 +1293,11 @@
      */
     public double getDouble(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getDouble(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getDouble(index);
     }
 
     /**
@@ -1164,7 +1313,11 @@
      */
     public byte[] getBytes(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getBytes(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getBytes(index);
     }
 
     /**
@@ -1179,7 +1332,11 @@
      */
     public java.sql.Date getDate(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getDate(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getDate(index);
     }
 
     /**
@@ -1194,7 +1351,11 @@
      */
     public java.sql.Time getTime(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getTime(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getTime(index);
     }
 
     /**
@@ -1209,7 +1370,11 @@
      */
     public java.sql.Timestamp getTimestamp(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getTimestamp(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getTimestamp(index);
     }
 
     /**
@@ -1231,7 +1396,11 @@
      */
     public Object getObject(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getObject(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getObject(index);
     }
 
     /**
@@ -1247,7 +1416,11 @@
      */
     public BigDecimal getBigDecimal(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getBigDecimal(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getBigDecimal(index);
     }
 
     /**
@@ -1269,7 +1442,11 @@
      */
     public Object getObjectImpl (String parameterName, java.util.Map map) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getObject(String,Map)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getObject(index);
     }
 
     /**
@@ -1285,7 +1462,11 @@
      */
     public Ref getRef (String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getRef(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getRef(index);
     }
 
     /**
@@ -1301,7 +1482,11 @@
      */
     public Blob getBlob (String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getBlob(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getBlob(index);
     }
 
     /**
@@ -1316,7 +1501,11 @@
      */
     public Clob getClob (String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getClob(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getClob(index);
     }
 
     /**
@@ -1332,7 +1521,11 @@
      */
     public Array getArray (String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getArray(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getArray(index);
     }
 
     /**
@@ -1357,7 +1550,11 @@
     public java.sql.Date getDate(String parameterName, Calendar cal)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getDate(String,Calendar)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getDate(index);
     }
 
     /**
@@ -1382,7 +1579,11 @@
     public java.sql.Time getTime(String parameterName, Calendar cal)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getTime(String,Calendar)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getTime(index);
     }
 
     /**
@@ -1408,7 +1609,11 @@
     public java.sql.Timestamp getTimestamp(String parameterName, Calendar cal)
     throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getTimestamp(String,Calendar)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getTimestamp(index,cal);
     }
 
     /**
@@ -1426,7 +1631,11 @@
      */
     public java.net.URL getURL(String parameterName) throws SQLException
     {
-        throw org.postgresql.Driver.notImplemented(this.getClass(), "getURL(String)");
+    	int index = findParameterIndex(parameterName);
+    	if (index == -1)
+    		throw new org.postgresql.util.PSQLException(GT.tr("Parameter not found:"+parameterName, this.getClass().getName()),PSQLState.NO_DATA);
+    	else
+    		return getURL(index);
     }
 
     public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
@@ -1473,4 +1682,90 @@
         // ignore scale for now
         registerOutParameter(parameterIndex, sqlType );
     }
+    
+    
+    
+    
+    // This map is for the next function
+    protected Map<String,Integer> parameterNameMap = new HashMap<String,Integer>();
+    private String actualProcedureName = "";
+    
+    protected int findNumberOfChars(String tmpString,char tmpChar)
+    {
+    	int number = 0;
+    	if (tmpString!=null)
+    	{
+    		while (tmpString.indexOf(tmpChar)!=-1)
+    		{
+    			tmpString = tmpString.substring(tmpString.indexOf(tmpChar)+1);
+    			number++;
+    		}
+    	}
+    	return number;
+    }
+    
+    /** 
+     * This is implementation of setParameter(String,Object) by the Name of the sored procedure parameter.
+     * 
+     * */
+    protected int findParameterIndex(String parameterName)
+    {
+    	// finding procedure name
+    	String procedureName = preparedQuery.toString();
+    	String selectQuery = null;
+    	procedureName = procedureName.substring(procedureName.indexOf("from")+5);
+    	
+    	int index = procedureName.indexOf('(');
+    	if (procedureName.indexOf(' ') < index)
+    		index = procedureName.indexOf(' '); 
+    	procedureName = procedureName.substring(0,index);
+
+    	if (!actualProcedureName.equalsIgnoreCase(procedureName))
+    	{
+    		actualProcedureName = procedureName;
+    		parameterNameMap.clear();
+    	
+    		selectQuery = "select proargnames from pg_proc where proname ilike '"+procedureName+"'"; 
+    		selectQuery = selectQuery.replaceAll("\"","");
+    		
+/*    		System.out.println("SQL = "+preparedQuery.toString());
+    		System.out.println("FULL SQL = "+preparedQuery.toString(preparedParameters)); */
+    	
+    		String parameters = null;
+    		ResultSet rs;
+    		try {
+    			rs = connection.createStatement().executeQuery(selectQuery);
+    			if (rs.next()) {
+    				parameters = rs.getString(1);
+    			}
+    			rs.close();
+    		} catch (SQLException e) {
+    			e.printStackTrace();
+    		}
+    		
+    		if (parameters != null)
+    		{
+    			parameters = parameters.substring(1,parameters.length()-1);
+    	    	
+    	    	StringTokenizer st = new StringTokenizer(parameters,",");
+    	    	int count = 1;
+    	    	
+    	    	if (findNumberOfChars(preparedQuery.toString(),'?') > findNumberOfChars(parameters,',')+1)
+    	    		count++;
+    	    	
+    	        while (st.hasMoreTokens()) {
+    	        	parameterNameMap.put(st.nextToken().toLowerCase(),count);
+    	        	count++;
+    	        }
+    		}
+    	}
+    	parameterName = parameterName.toLowerCase();
+    	
+    	Integer num = parameterNameMap.get(parameterName);
+    	if (num==null)
+    		return -1;
+    	else
+    		return num;
+    }
+    
 }

Success, CVS operation completed

